package caiziyou.com.designpattern.factory.simple.pizzastore;

public class SimpleFactory {

	public Pizza createPizza(String orderType) {
		Pizza pizza = null;
		if(orderType.equals("greek")) {
			pizza = new GeekPizza();
			pizza.setName("希腊披萨");
		}else if (orderType.equals("cheese")) {
			pizza = new CheesePizza();
			pizza.setName("奶酪披萨");
		}else if (orderType.equals("pepper") ){
			pizza = new PepperPizza();
			pizza.setName("胡椒披萨");
		}else {
			
		}
		pizza.prepare();
		pizza.bake();
		pizza.cut();
		pizza.box();
		return pizza;
	}
	
	public static Pizza createPizza1(String orderType) {
		Pizza pizza = null;
		if(orderType.equals("greek")) {
			pizza = new GeekPizza();
			pizza.setName("希腊披萨");
		}else if (orderType.equals("cheese")) {
			pizza = new CheesePizza();
			pizza.setName("奶酪披萨");
		}else if (orderType.equals("pepper") ){
			pizza = new PepperPizza();
			pizza.setName("胡椒披萨");
		}else {
			
		}
		pizza.prepare();
		pizza.bake();
		pizza.cut();
		pizza.box();
		return pizza;
	}
}
